1. Field of the Invention
This invention relates to an image processing method and apparatus for performing a quantization processing of image data, and more particularly, to an image processing method and apparatus for reproducing a half-tone image.
2. Description of the Prior Art
Heretofore, there has been know an error diffusion method for use as an image processing method for reproducing a half-tone image by, for example, a binary image reproducing method, in a digital copier, digital facsimile and the like.
In this method, a difference in density, for every picture element, between the density of an image of an original document and the density of the corresponding picture element of the binary-coded output image, that is, an error is determined and the value of the error so determined is dispersed, after performing a specific weighting to picture elements surrounding the picture element in question in accordance with coefficients of a weighting matrix.
Since this method spatially clears an error which is a difference in density between an image of an original document and an output image, there is no limitation on the number of gradations due to the size of a matrix as in a dither processing (which is another binary-coding method), and it is possible to perform a threshold processing which depends on the value of a picture element.
Accordingly, the error diffusion method makes possible compatibility of gradation and resolution, which is a problem in dither processing.
The error diffusion method has been presented in R. W. Floyd and L. Steinberg, "An Adaptive Algorithm for Spatial Gray Scale", SID75 Digest (1976).
The expression of the error diffusion method is as follows. In the following expression, input data are assumed to be of 6 bits; EQU Di,j=Xi,j+(.SIGMA..SIGMA..alpha.i+m,j+n.multidot.Ei+m, j+n)(1/.SIGMA..alpha.m,n) EQU Yi,j=63(Di,j.gtoreq.T) EQU Yi,j=0(Di,j&lt;T),
where
Di,j: the density of the picture element (i,j) in question after correction PA1 Xi,j: the density of an input image of the picture element (i,j) in question PA1 Ei,j: the error when the picture element (i.j) in question is binary-coded PA1 .alpha.i,j: weighting cofficient PA1 Yi,j: the density of an output image PA1 T: threshold value. PA1 arithmetic means for determining an error between the input image data and output image data; PA1 processing means for performing a predetermined weight ing processing to the error; PA1 means for dispersing the error subjected to the weight ing processing by the processing means; and PA1 correction means for correcting a remainder of the error which is generated when the weighting processing is performed in the processing means.
That is, in the above expression, weighted by (multiplying .alpha.i+m,j+n and dividing by .SIGMA..alpha.m,n) values of errors Ei+m,j+n generated at surrounding picture elements are added to the density Xi,j of an input image of the picture element in question, and the resultant value becomes the density Di,j of the picture element in question after error correction. The density Yi,j of an output image is obtained by binary-coding the Di,j using a threshold value T (for example, T=32).
A printer performs an on/off control of a dot (i.e., prints a dot or not in accordance with the value of the Yi,j to perform image formation.
However, when highlight portions of an image are binary-coded by the error diffusion method, there is the disadvantage that grain-like noises are generated in the highlight portions of the image. In order to remove this disavantage, the assignee of the present invention has filed S.N. 289,017.
The error diffusion method also has the disadvantage that a unique texture (a striped pattern) appears in highlight and half-tone portions of an image. This is caused by dots of binary outputs connected in a line.
Now, the cause of such generation of the texture will be investigated. As described above, in the error diffusion method, an error generated in a picture element in question is weighted using a weighting matrix and diffused to surrounding picture elements.
For example, a weighting matrix .alpha.i,j (X,1), that is, for a case in which an error generated at a picture element X in question is dispersed to an adjacent picture element to the right, will be investigated.
Since there is a higher probability of an output image being 0 in highlight and half-tone portions of an image compared with dark portions, a positive error is generated in many cases. A positive error is generated when an output image is made 0, since input image data have at least a certain degree of density.
When the positive error is dispersed to an adjacent picture element to the right with the above-described weighting matrix .alpha.i,j(X,1), the probability of a dot being "on" at the dispersed picture element (the adjacent picture element) becomes high. When processing for one line of input image data is completed and the processing is shifted to the next line, the positive error is also dispersed to a picture element which corresponds to that in the preceding line (a picture element under that in the preceding line), and the probability of the dot of this picture element being "on" also becomes high.
That is, the probability of dots being "on" becomes high periodically in the subscanning direction, and a striped pattern is generated due to connection of these dots. An appearance of the generation of a striped pattern in the subscanning direction is shown in FIG. 25.
According to the shape of the weighting matrix, dots may also be connected in the main scanning direction or in an oblique direction, and a striped pattern is generated.
As described above, although, in the conventional error diffusion method, resolution is excellent compared with dither processing, this unique texture (a striped pattern) is generated in highlight and half-tone portions of an image, and it is impossible to reproduce an excellent image.
Now, in the error diffusion method, the processing for determining values to be distributed to surrounding picture elements from the error generated at a picture element in question will be investigated.
The error generated when the density Xi,j of an input image of a picture element (i,j) in question is binary-coded is represented by Ei,j, and the weighting matrix .alpha.i,j is represented by ##EQU1## X: a picture element in question.
In order to determine distribution values, first the error Ei,j is divided by the sum 10 of numbers which make up the weight ing matrix .alpha.i,j, and values in which each coefficient of .alpha.i,j is multiplied by that sum become distribution values of the Ei,j to surrounding picture elements.
For example, if Ei,j=25, the values become
______________________________________ to picture element (i + 1, j) 4*Int(25*1/10) = 8 to picture element (i - 1, j) 1*Int(25*1/10) = 2 to picture element (i, j + 1) 4*Int(25*1/10) = 8 to picture element (i + 1, j + 1) 1*Int(25*1/10) = 2. ______________________________________
In this example, the configuration is provided by hardware, and is designed to truncate values to the right of the decimal point for the sake of simplification.
When the above-calculated distribution values are added, the result is EQU E i,j=8+2+8+2=20.
This value is different from Ei,j=25.
The difference (Ei,j-E i,j) is caused by neglecting the remainder when the error is divided by 10.
In the case of the error diffusion method, if there is a difference between the error generated at a picture element in question and the error diffused to surroundings, the density of an input image is not preserved. Hence, it results that the density of an input image does not equal the density of an output image, and the picture quality of the outout image deteriorates.
When a decimal-point operation (it is necessary to execute a decimal-point operation of at least two digits in order to prevent the deterioration of an image) is used in order to solve the above-described problems, circuit scale becomes very large, and so this approach is not an effective method.
As described above, the conventional error diffusion method has the disadvantage that, if an error due to a remainder or surplus which is generated when an error is weighed is neglected, density not preserved, and picture quality is deteriorates.
There is also the disadvantage that, if it is tried to suppress the influence of the remainder by performing a decimal-point operation, circuit scale becomes very large.